
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的地址</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <link type="text/css" rel="stylesheet" href="__TMPL__Public/assets/css/orderstyle.css">
    <script src="__TMPL__Public/assets/js/jquery-v1.10.2.min.js"></script>
    <script type="text/javascript" src="__TMPL__Public/assets/layer/layer.js"></script>
</head>
<body>
<div class="bgl03" id="myaddresslist">
    <div class="dzBox" data-id="5914" id="add_5914">
        <div class="dzInf">
            <h3>刘先生<span class="dh">15011417119</span></h3>
            <p>双桥东柳家园</p>
        </div>
        <div class="dzc">
            <input class="dzc_qd" type="button" value="确定" name="dz"  id="dz1"><label for="dz1"></label>
        </div>
        <div class="cz">
            <a href="/index.php/Mobile/Order/edit/address_id/5914.html" class="bj">编辑</a>
            <a href="javascript:void(0)" onclick="del(5914)" class="sc">删除</a>
        </div>
    </div>
    <div class="dzBtn"><a href="/index.php/Mobile/Order/add/id/0.html">添加新收货地址</a></div>
</div>
<style>
    .dzc_qd{
        background: rgb(139, 194, 233);
        border-radius: 8px;
        color: rgb(255, 255, 255);
        font-size: 13px;
        line-height: 2.5rem;
        width:70px;
    }
</style>
<script>
    $(function(){
        $('input[name="dz"]').click(function(){
            var address_id = $(this).closest('.dzBox').attr('data-id');
            window.location.href = "http://wx.yunxiaofu.com.cn/index.php/Mobile/Order/index/address_id/"+address_id;
        });
    });
    function del(id){
        layer.open({type: 2,time:60,shadeClose:false});
        $.post('/index.php/Mobile/Order/del.html',{'id':id},function(data){
            var data = $.parseJSON(data);
            if(data.status == 1){
                layer.closeAll();
                layer.open({
                    content: data.msg,
                    time: 2,
                    end: function(elem){
                        $('#add_'+id).remove();
                    }
                });

            }else{
                layer.closeAll();
                myalert(data.msg);
            }
        });
    }

    function myalert(con){
        layer.open({
            content: con,
            time: 3
        });
    }
</script>
</body>
</html>